"0", ARGTYPE_BOOL, ARG_NOMINMAX },
{ "targetlocation", &opt_set_location, "Set location finder target location as lat,lng",
"", ARGTYPE_STRING, "", "" },
+ { "baud", &opt_dlbaud, "Baud rate used for download",
+ "230400", ARGTYPE_INT, "0", "230400" },
{ "initbaud", &opt_initbaud, "Baud rate used to init device (0=autodetect)",
"0", ARGTYPE_INT, "4800", "230400" },
- { "baud", &opt_dlbaud, "Baud rate used for download",
- "230400", ARGTYPE_INT, "4800", "230400" },
{ "read-at-once", &opt_read_at_once, "Number of sectors to read at once (0=use single sector mode)",
"255", ARGTYPE_INT, "0", "255" },
{ "first-sector", &opt_first_sector, "First sector to be read from the device",
"-1", ARGTYPE_INT, "-1", "65535" },
{ "dump-file", &opt_dump_file, "Dump raw data to this file",
NULL, ARGTYPE_OUTFILE, ARG_NOMINMAX },
- { "no-output", &opt_no_output, "Disable output (useful with e.g. erase or targetlocation)",
+ { "no-output", &opt_no_output, "Disable output (useful with erase)",
"0", ARGTYPE_BOOL, ARG_NOMINMAX },
ARG_TERMINATOR
};
}
}
- while (read_at_once > 0 && !(buffer = xmalloc(SECTOR_SIZE*read_at_once+sizeof(SECTOR_READ_END)+6))) {
- read_at_once--;
- }
- if (read_at_once == 0) fatal(MYNAME ": Can't allocate buffer for reading\n");
+ buffer = xmalloc(SECTOR_SIZE*read_at_once+sizeof(SECTOR_READ_END)+6);
+ // m.ad/090930: removed code that tried reducing read_at_once if necessary since doesn't work with xmalloc
if (opt_dump_file) {
dumpfile = gbfopen(opt_dump_file, "w", MYNAME);
{
int dlbaud;
+ if (*opt_set_location) {
+ skytraq_set_location();
+ return;
+ }
+
dlbaud = atoi(opt_dlbaud);
- if (dlbaud != skytraq_baud) {
+ if (dlbaud != 0 && dlbaud != skytraq_baud) {
skytraq_set_baud(dlbaud);
}
- if (*opt_set_location) {
- skytraq_set_location();
-// return;
- }
-
// read device unless no-output=1 and dump-file=0 (i.e. no data needed at all)
if (*opt_no_output == '0' || opt_dump_file != NULL) {
skytraq_read_tracks();
skytraq_erase();
}
- skytraq_set_baud(skytraq_baud); // note that _system_restart resets baud rate anyway...
+ if (dlbaud != 0 && dlbaud != skytraq_baud) {
+ skytraq_set_baud(skytraq_baud); // note that _system_restart resets baud rate anyway...
+ }
skytraq_system_restart();
}
<para>The following baud rates can be used: 4800, 9600, 19200, 38400, 57600, 115200, 230400.
-Note that your logger might support only a subset of them (especially 230400 which isn't documented
-in the chipset manual, though there are devices that are capable of this speed).</para>
+Note that your logger might not support all of them (especially 230400 which isn't documented
+in the chipset manual, though there are known devices that are capable of this speed).</para>
+
+<para>If <userinput>baud=0</userinput> (zero) download takes place at the baud rate the
+device is currently set to. This is especially useful for Bluetooth connections since they
+often don't allow changing the baud rate.</para>
</example>
<para>If available, reading the logger using bluetooth should also work. However, many devices support only one
-specific baud rate over bluetooth, e.g. 9600:</para>
+specific baud rate over bluetooth, e.g. 9600. In that case you should use the option <userinput>baud=0</userinput>
+to tell GPSBabel to use that default baud rate:</para>
<example id="skytraq-on-linux-bt">
<title>Command showing skytraq download tracks via bluetooth on Linux</title>
<para><userinput>rfcomm bind 0 <bdaddr></userinput></para>
- <para><userinput>gpsbabel -i skytraq,baud=9600 -f /dev/rfcomm0 -o gpx -F out.gpx</userinput></para>
+ <para><userinput>gpsbabel -i skytraq,baud=0 -f /dev/rfcomm0 -o gpx -F out.gpx</userinput></para>
</example>